import logging
import requests


def 退货退款上传(filepath):
    url = 'http://192.168.16.240:8001/api/VerifyOrder/ReturnOrderScan/ImportAfterSales'
    files = {'file': ('售后退货退款.xlsx', open(filepath, 'rb'))}
    res = requests.post(url, files=files)
    if res.status_code == 200 and 'false' not in res.text:
        # print('订单上传成功')
        # print(res.text)
        logging.info(res.text)
        logging.info('订单上传成功')
    else:
        # print('订单上传失败')
        # print(res.text)
        logging.info(res.text)
        logging.info('订单上传失败')

# 退货退款上传(r"C:\售后退货退款\2024-02-01\售后退货退款.xlsx")